package com.fast.linkbeanadmin.controller.user;

import com.fast.linkbeanadmin.pojo.response.ResultBean;
import com.fast.linkbeanadmin.pojo.vo.UserVO;
import com.fast.linkbeanadmin.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

/**
 * @author ruan cai yuan
 * @version 1.0
 * @fileName com.fast.linkbeanadmin.controller.user.UserController
 * @description: TODO
 * @since 2024/7/21 下午5:46
 */
@RestController
@RequestMapping("/user")
@Validated
@Slf4j
public class UserController {

    @Resource
    private SysUserService userService;

    /**
     * 根据用户的ID查询用户
     *
     * @param id 用户ID
     */
    @GetMapping("/queryById")
    public ResultBean queryById(@NotNull Long id) {
        UserVO userVO = userService.queryById(id);
        return ResultBean.success(userVO);
    }

}
